
public class NumberToken extends Token {

	public Integer value;
	
	public Object getValue() throws ENumberOverflowException {
		try{
			value = (image  == null)?new Integer(0):new Integer(image);
		}catch(NumberFormatException e) {
			throw new ENumberOverflowException();
		}
		return value;
	}
	
	public String toString() {
		String numberRepresentation;
		try {
			if(value == null)
				value = (Integer) getValue();
			numberRepresentation = value.toString();	// nothing to do, Integer automatically removes leading 0s
			
		}catch(ENumberOverflowException e) {
			numberRepresentation = "<overflow>";
		}
		return numberRepresentation;
	}
}
